/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-05-17     fanlulin       the first version
 */
#include "board_config.h"


void board_init(){
    //LED设置为输出模式
    rt_pin_mode(LEDR_PIN, PIN_MODE_OUTPUT);
    rt_pin_mode(LED_PIN1, PIN_MODE_OUTPUT);
    rt_pin_mode(LED_PIN2, PIN_MODE_OUTPUT);
    rt_pin_mode(LED_PIN3, PIN_MODE_OUTPUT);


    //LED共阳极，给高电平让LED熄灭
    rt_pin_write(LEDR_PIN, PIN_HIGH);
    rt_pin_write(LED_PIN1, PIN_HIGH);
    rt_pin_write(LED_PIN2, PIN_HIGH);
    rt_pin_write(LED_PIN3, PIN_HIGH);


    //按键初始化
    rt_pin_mode(KEY1_PIN, PIN_MODE_INPUT_PULLUP);
    rt_pin_mode(KEY2_PIN, PIN_MODE_INPUT_PULLUP);

    //串口初始化
    fpioa_set_function(26,FUNC_UART1_RX);
    fpioa_set_function(27,FUNC_UART1_TX);
}


